﻿package com.moonshineproject.text 
{
	public class TextLineModel
	{
		protected var _text:String;
		protected var _meta:Vector.<int>;
		protected var _breakPoint:Boolean;
		protected var _width:Number = -1;
		
		public function set text(v:String):void
		{
			_text = v;
		}
		public function get text():String
		{
			return _text;
		}
		
		public function set meta(v:Vector.<int>):void
		{
			_meta = v;
		}
		public function get meta():Vector.<int>
		{
			return _meta;
		}
		
		public function set breakPoint(v:Boolean):void
		{
			_breakPoint = v;
		}
		public function get breakPoint():Boolean
		{
			return _breakPoint;
		}
		
		public function set width(v:Number):void
		{
			_width = v;
		}
		public function get width():Number
		{
			return _width;
		}
		
		public function get startContext():int
		{
			return _meta && _meta.length > 1 ? _meta[1] : 0;
		}
		
		public function get endContext():int
		{
			return _meta && _meta.length > 1 ? _meta[_meta.length-1] : 0;
		}
		
		public function TextLineModel(text:String)
		{
			this.text = text;
		}
		
		public function toString():String
		{
			return text;
		}
	}
}